package main

import (
	"bytes"
	"fmt"
	"strings"
)

func test_writeBuffer() {
	var buffer bytes.Buffer
	buffer.WriteString("hello")
	buffer.WriteString(" world ")
	fmt.Println(buffer.String())
}

func test_join() {
	ss := strings.Join([]string{"hello", "world"}, ", ")
	fmt.Println(ss)
}

func test_sprintf() {
	ss := fmt.Sprintf("%s, %s", "hello", "world")
	fmt.Println(ss)
}

func test_map() {
	ss := "00000"
	for i, c := range ss {
		fmt.Printf("%d, %d\n", i, c)
	}

}

func main() {
	var ss string
	ss = " bac9888c a "
	fmt.Println(strings.Index(ss, "a"))
	fmt.Println(strings.IndexAny(ss, "a"))
	fmt.Println(strings.IndexByte(ss, 'c'))
	fmt.Println(strings.Contains(ss, "e"))
	fmt.Println(strings.Trim(ss, " "))
	fmt.Println(ss)
	test_writeBuffer()
	test_join()
	test_sprintf()
	test_map()
}
